package cvut.fit.dpo.arithmetic;

import cvut.fit.dpo.arithmetic.elements.ExpressionElement;
import cvut.fit.dpo.arithmetic.elements.SubstractOperation;

/**
 * Represents - operation
 * 
 * @author Jan Kurš
 */
public class SubstractOperator extends BinaryOperator {

	public SubstractOperator(final ArithmeticExpression firstOperand, final ArithmeticExpression secondOperand) {
		super(firstOperand, secondOperand);
	}

	@Override
	public Integer evaluate() {
		return getFirstOperand().evaluate() - getSecondOperand().evaluate();
	}

	@Override
	public ExpressionElement getRepresentationInExpresionModel() {
		return new SubstractOperation();
	}

}
